﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using Framework.Data.Exceptions;

namespace Framework.Data.Core
{
    public interface IContainer
    {
        IBaseEntity Parent { get; set; }
        IEntityCollection<object, IBaseEntity> EntityCollection { get; }
        System.Type EntityType { get; }
        List<string> Filters { get; }
        string SortOrder { get; set; }
        bool IsLoaded { get; set; }
        void LoadData(IDbConnection connection = null, Int32 fetchRowCount = 250, Int32 rowsPerPage = 0, Int32 pageIndex = 0);
        void LoadData(bool forceReload, IDbConnection connection = null, Int32 fetchRowCount = 250, Int32 rowsPerPage = 0, Int32 pageIndex = 0);
        IBaseEntity CreateEntity(IDbConnection connection = null);
        IBaseEntity DuplicateEntity(IBaseEntity entity, IDbConnection connection = null);
        bool RemoveEntity(IBaseEntity entity);
        bool Save(IDbConnection connection = null);
        List<AppException> ValidateRules();
        bool IsDirty();
        void AcceptChanges();
        void RejectChanges();
    }
}